// 引入vue
import Vue from 'vue'
// 引入vue-router
import VueRouter from 'vue-router'

// 引入登录组件
import login from '../view/login'
// 引入index组件
import index from '../view/index'
// 引入Goods
import Goods from '@/view/goods/Goods'
// 应用vue-router
Vue.use(VueRouter)

// 创建router实例对象
const router = new VueRouter({
    routes: [
        {
            path: '/',
            component: login
        },
        {
            path: '/index',
            component: index,
            meta: { isAuth: true },
            children: [
                {
                    path: '/goods/Goods',
                    component: Goods,
                    name: '商品管理'
                }
            ]
        }
    ]
})

// 暴露router
export default router